home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / jcool01.zip / DATE_TIM.H < prev    next >
Text File  |  1992-08-12  |  23KB  |  548 lines

  1. //
  2. // Copyright (C) 1991 Texas Instruments Incorporated.
  3. //
  4. // Permission is granted to any individual or institution to use, copy, modify,
  5. // and distribute this software, provided that this complete copyright and
  6. // permission notice is maintained, intact, in all copies and supporting
  7. // documentation.
  8. //
  9. // Texas Instruments Incorporated provides this software "as is" without
  10. // express or implied warranty.
  11. //
  12. //
  13. // Created: MBN 04/11/89 -- Initial design and implementation
  14. // Updated: LGO 07/03/89 -- Inherit from Generic
  15. // Updated: MNF 07/25/89 -- Add the parse member function 
  16. // Updated: MBN 09/06/89 -- Added conditional exception handling
  17. // Updated: MBN 01/17/90 -- Fixed parsing algorithms to be GMT relative
  18. // Updated: MBN 02/06/90 -- Support years prior to the epoch (1/1/1970)
  19. // Updated: MBN 02/12/90 -- Changed all ascii() functions to return const char*
  20. // Updated: MBN 02/13/90 -- Made ascii_duration() a member function for epoch
  21. // Updated: DLS 03/22/91 -- New lite version
  22. // Updated: JAM 08/11/92 -- removed DOS specifics, stdized #includes
  23. // Updated: JAM 08/12/92 -- removed 'inline' from friend declarations
  24. //
  25. // The Date_Time class provides  an   application programmer  with  simplified
  26. // access to the operating system date and time values, along with support for
  27. // comparison to other dates and times, calendar adjustment, and international
  28. // support  for   display formats.   To  implement  this functionality,  three
  29. // additional header files  are maintained: <country.h> providing symbolic and
  30. // character    string  definitions  for      the various supported  contries;
  31. // <timezone.h>  that enumerates symbolic  and character string values for all
  32. // major  time zones; and <calendar.h>  that  lists  the days of the week  and
  33. // months of the year.  The following countries and their associated date/time
  34. // format are supported:
  35. //
  36. //                United States          03-29-1989 17:35:00
  37. //                French Canadian        1989-29-03 17:35:00
  38. //                Latin America          03/29/1989 17:35:00
  39. //                Netherlands            03-29-1989 17:35:00
  40. //                Belgium                03/29/1989 17:35:00
  41. //                France                 03/29/1989 17:35:00
  42. //                Spain                  03/29/1989 17:35:00
  43. //                Italy                  03/29/1989 17:35:00
  44. //                Switzerland            03.29.1989 17.35.00
  45. //                United Kingdom         29-03-1989 17:35:00
  46. //                Denmark                03/29/1989 17:35:00
  47. //                Sweden                 1989-29-03 17.35.00
  48. //                Norway                 03/29/1989 17:35:00
  49. //                Germany                03.29.1989 17.35.00
  50. //                Portugal               03/29/1989 17:35:00
  51. //                Finland                03.29.1989 17.35.00
  52. //                Arabic Countries       03/29/1989 17:35:00
  53. //                Israel                 03 29 1989 17:35:00
  54. //
  55. // The private data section contains a  long integer that  maintains the system
  56. // date and  time as an interval  from the base  date of 01/01/1970 00:00:00am.
  57. // This  is supported  and  structure  in an ANSI  C <time.> tm structure that
  58. // keeps separate fields for seconds,  minutes, hours,  day   of month, day  of
  59. // week, month, year, and day of year.  Two other slots  provided time zone and
  60. // country code values for   each  Date_Time object.   In addition,  two static
  61. // slots containing  the default time zone and  country code for the  Date_Time
  62. // class as a whole are defined.  The following time zones are supported:
  63. //  
  64. //        US/Eastern:                  Eastern time zone, USA                 
  65. //        US/Central:                  Central time zone, USA                 
  66. //        US/Mountain:                 Mountain time zone, USA                
  67. //        US/Pacific:                  Pacific time zone, USA                 
  68. //        US/Pacific-New:              Pacific time zone, USA with DST changes
  69. //        US/Yukon:                    Yukon time zone, USA                   
  70. //        US/East-Indiana:             Estern time zone, USA with no DST      
  71. //        US/Arizona:                  Mountain time zone, USA with no DST    
  72. //        US/Hawaii:                   Hawaii                                 
  73. //        Canada/Newfoundland:         Newfoundland                           
  74. //        Canada/Atlantic:             Atlantic time zone, Canada             
  75. //        Canada/Eastern:              Eastern time zone, Canada              
  76. //        Canada/Central:              Central time zone, Canada              
  77. //        Canada/East-Saskatchewan:    Central time zone, Canada with no DST  
  78. //        Canada/Mountain:             Mountain time zone, Canada             
  79. //        Canada/Pacific:              Pacific time zone, Canada              
  80. //        Canada/Yukon:                Yukon time zone, Canada                
  81. //        GB-Eire:                     Great Britain and Eire (GMT)           
  82. //        WET:                         Western Europe time                    
  83. //        Iceland:                     Iceland                                
  84. //        MET:                         Middle Europe time                     
  85. //        Poland:                      Poland                                 
  86. //        EET:                         Eastern Europe time                    
  87. //        Turkey:                      Turkey                                 
  88. //        W-SU:                        Western Soviet Union                   
  89. //        PRC:                         People's Republic of China             
  90. //        Korea:                       Republic of Korea                      
  91. //        Japan:                       Japan                                  
  92. //        Singapore:                   Singapore                              
  93. //        Hongkong:                    Hongkong                               
  94. //        ROC:                         Republic of China                      
  95. //        Australia/Tasmania:          Tasmainia, Australia                   
  96. //        Australia/Queensland:        Queensland, Australia                  
  97. //        Australia/North:             Northern Territory, Australia          
  98. //        Australia/West:              Western Australia                      
  99. //        Australia/South:             South Australia                        
  100. //        Australia/Victoria:          Victoria, Australia                    
  101. //        Australia/NSW:               New South Wales, Australia             
  102. //        NZ:                          New Zealand                            
  103. //
  104. // There are five constructors for the Date_Time  class.  The first constructor
  105. // takes no arguments and intializes an empty object, setting the time zone and
  106. // the  country  code   to  the  default values   for  the class.   The  second
  107. // constructors takes a time  zone and country code and  initializes an  object
  108. // for the specified local time zone and  country.  The third constructor takes
  109. // a reference to some  other Date_Time object and  copies all the slot values.
  110. // To get the time from a char*, first  create an  object with its country code
  111. // set, and then use parse to fill in the slots.
  112. //
  113. // Public methods are provided for incrementing and  decrementing  the date and
  114. // time, various   logical  tests   for  equality and  inequality,    and ASCII
  115. // representation  of the   date  and/or  time   formatted   according  to  the
  116. // appropriate country standard.  Two methods are  provided  to set a Date_Time
  117. // object to either  the local time  (adjusted for  day  light savings time, if
  118. // necessary) and  Greenwich Mean Time.   In  addition, several  public methods
  119. // have been implemented for  interval arithmetic allowing messages  to be sent
  120. // to the object along the lines of "move forward three weeks", "back up to end
  121. // of last  month", etc.  Two  methods are  provided to  change the   time zone
  122. // and/or country for a particular Date_Time object.  Finally accessors for all
  123. // fields in the  <time.h> structure and  the  ASCII representation of the time
  124. // zone and country are provided.
  125. //
  126. // Two other methods are also  implemented to  be used by  other methods of the
  127. // class.  The first is a private member function that maintains  the integrity
  128. // of   a  Date_Time object after  interval  arithmetic,  updating  to the next
  129. // hour/day/month, etc.   The second is a  private friend function that takes a
  130. // time zone value and  updates the local time  conversion information used for
  131. // converting between GMT and the specified time zone.
  132.  
  133. #ifndef DATETIMEH                // If we have not defined class
  134. #define DATETIMEH                // Indicate class Date_Time
  135.  
  136. #include <time.h>
  137. #include <iostream.h>
  138.  
  139. #ifndef MISCELANEOUSH                // If no misc.h file
  140. #include <misc.h>            // Include useful defintions
  141. #endif    
  142.  
  143. #ifndef CHARH
  144. #include <cool/char.h>
  145. #endif
  146.  
  147. #ifndef STRINGH
  148. #include <cool/String.h>
  149. #endif
  150.  
  151. #ifndef COUNTRYH
  152. #include <cool/country.h> 
  153. #endif
  154.  
  155. #ifndef TIMEZONEH
  156. #include <cool/timezone.h>
  157. #endif
  158.  
  159. #ifndef CALENDARH
  160. #include <cool/calendar.h>
  161. #endif
  162.  
  163. class CoolDate_Time {
  164. public:
  165.   CoolDate_Time ();                // Simple constructor
  166.   CoolDate_Time (time_zone, country);        // Constructor with TZ/Country
  167.   CoolDate_Time (const CoolDate_Time&);        // Constructor with reference
  168.   ~CoolDate_Time ();                // Destructor
  169.   
  170.   void set_gm_time ();                          // Sets Greenwich Mean Time
  171.   void set_local_time ();                       // Sets local time 
  172.   inline void set_time_zone (time_zone);    // Set time zone for object
  173.   inline void set_country (country);        // Set country for object
  174.   friend void set_default_time_zone (time_zone);// Set default time zone
  175.   friend void set_default_country (country);    // Set default country
  176.  
  177.   CoolDate_Time& operator= (const CoolDate_Time&); // CoolDate_Time x = y;
  178.   inline long operator- (const CoolDate_Time&) const; // Interval subtraction
  179.   CoolDate_Time& operator+= (long);              // Interval addition/assignment
  180.   CoolDate_Time& operator-= (long);              // Interval subtraction/assign
  181.  
  182.   friend istream& operator>> (istream&, CoolDate_Time&);
  183.   friend ostream& operator<< (ostream&, const CoolDate_Time&);
  184.   friend ostream& operator<< (ostream&, const CoolDate_Time*);
  185.   
  186.   void incr_sec (int n = 1);                    // Advance seconds (default 1)
  187.   void incr_min (int n = 1);                    // Advance minutes (default 1)
  188.   void incr_hour (int n = 1);                   // Advance hours (default 1)
  189.   void incr_day (int n = 1);                    // Advance day (default 1)
  190.   void incr_week (int n = 1);                   // Advance week (default 1)
  191.   void incr_month (int n = 1);                  // Advance month (default 1)
  192.   void incr_year (int n = 1);                   // Advance year (default 1)
  193.   
  194.   inline void decr_sec (int n = 1);             // Decrement second (default 1)
  195.   inline void decr_min (int n = 1);             // Decrement minute (default 1)
  196.   inline void decr_hour (int n = 1);            // Decrement hours (default 1)
  197.   inline void decr_day (int n = 1);             // Decrement day (default 1)
  198.   inline void decr_week (int n = 1);            // Decrement week (default 1)
  199.   void decr_month (int n = 1);                  // Decrement month (default 1)
  200.   void decr_year (int n = 1);                   // Decrement year (default 1)
  201.   
  202.   void start_min (int n = 1);   // Change to start of +/- "n" minute (default 1
  203.   void end_min (int n = 1);     // Change to end of +/- "n" minutes (default 1)
  204.   void start_hour (int n = 1);  // Change to start of +/- "n" hours (default 1)
  205.   void end_hour (int n = 1);    // Change to end of +/- "n" hours (default 1)
  206.   void start_day (int n = 1);   // Change to start of +/- "n" days (default 1)
  207.   void end_day (int n = 1);     // Change to end of +/- "n" days (default 1)
  208.   void start_week (int n = 1);  // Change to start of +/- "n" weeks (default 1)
  209.   void end_week (int n = 1);    // Change to end of +/- "n" weeks (default 1)
  210.   void start_month (int n = 1); // Change to start of +/- "n" month (default 1)
  211.   void end_month (int n = 1);   // Change to end of +/- "n" months (default 1)
  212.   void start_year (int n = 1);  // Change to start of +/- "n" years (default 1)
  213.   void end_year (int n = 1);    // Change to end of +/- "n" years (default 1)
  214.  
  215.   inline Boolean operator== (const CoolDate_Time&) const; // is same date/time
  216.   inline Boolean operator!= (const CoolDate_Time&) const; // is not same date/time
  217.   inline Boolean operator< (const CoolDate_Time&) const;  // is earlier date/time
  218.   inline Boolean operator> (const CoolDate_Time&) const;  // is later date/time
  219.   inline Boolean operator<= (const CoolDate_Time&) const; // is earlier or same
  220.   inline Boolean operator>= (const CoolDate_Time&) const; // is later or same
  221.  
  222.   const char* ascii_time () const;    // Return time in ASCII country format
  223.   const char* ascii_date () const;    // Return date in ASCII country format
  224.   const char* ascii_date_time () const;    // Return date/time ASCII country form
  225.   const char* ascii_duration (const CoolDate_Time&) const; // Return time duration 
  226.   void parse (char*, int settz = 0);    // Parses char* into the CoolDate_Time
  227.  
  228.   inline int get_sec () const;          // Return seconds from tm struct
  229.   inline int get_min () const;        // Return minutes from tm struct
  230.   inline int get_hour () const;        // Return hours from tm struct
  231.   inline int get_mday () const;        // Return day of month from tm struct
  232.   inline int get_mon () const;        // Return month from tm struct
  233.   inline int get_year () const;        // Return year from tm struct
  234.   inline int get_wday () const;        // Return day of week from tm struct
  235.   inline int get_yday () const;        // Return day of year from tm struct
  236.   inline Boolean is_day_light_savings () const; // Return daylight savings flag
  237.   inline const char* get_time_zone () const ; // Return ASCII form of time zone
  238.   inline const char* get_country () const; // Return ASCII form of country 
  239.   inline const char* get_day_name () const; // Return ASCII form of week day
  240.   inline const char* get_month_name () const; // Return ASCII form of month
  241.   
  242. private:
  243.   long time_seconds;                // Seconds 01/01/1970 00:00:00
  244.   /*struct*/ tm dt;                // OS date/time structure
  245.   country c_code;                // Retains date/time country
  246.   time_zone tz_code;                // Retains time zone code
  247.   long time_adjust;                // Time zone offset in seconds
  248.   int year_adjust;                // Year offset prior to epoch
  249.   int century;                    // Maintains century of year
  250.  
  251.   static time_zone default_tz_code_s;        // Default time zone
  252.   static country default_c_code_s;        // Default country
  253.   void resolve ();                // Resolve/update object
  254.   void adjust_tz ();                // Adjust for local time zone
  255.   void adjust_year (long&);            // Adjust for years < 1/1/1970
  256.   friend void set_tz (time_zone);        // Setup for local time zone
  257.   
  258.   friend int inrange (char);            // Helper function for parser
  259.   friend void getzone (CoolDate_Time&, char*);    // Gets time zone for parser
  260. };
  261.  
  262.  
  263. // set_time_zone -- Set the local time zone of a CoolDate_Time object
  264. // Input:           Time zone
  265. // Output:          None
  266.  
  267. inline void CoolDate_Time::set_time_zone (time_zone tz) {
  268.   this->tz_code = tz;
  269.   this->resolve ();
  270. }
  271.  
  272.  
  273. // set_country -- Set the country of a CoolDate_Time object
  274. // Input:         Country code
  275. // Output:        None
  276.  
  277. inline void CoolDate_Time::set_country (country c) {
  278.   this->c_code = c;
  279. }
  280.  
  281.  
  282. // set_default_time_zone -- Set the default time zone of the CoolDate_Time class
  283. // Input:           Time zone
  284. // Output:          None
  285.  
  286. inline void set_default_time_zone (time_zone tz) {
  287.   CoolDate_Time::default_tz_code_s = tz;
  288. }
  289.  
  290.  
  291. // set_default_country -- Set the default country of the CoolDate_Time class
  292. // Input:         Country code
  293. // Output:        None
  294.  
  295. inline void set_default_country (country c) {
  296.   CoolDate_Time::default_c_code_s = c;
  297. }
  298.  
  299.  
  300. // operator- -- Subtract one CoolDate_Time from a another to calculate
  301. //              the time interval between
  302. // Input:       this*, CoolDate_Time reference
  303. // Output:      Number of seconds presenting time interval 
  304.  
  305. inline long CoolDate_Time::operator- (const CoolDate_Time& d) const {
  306.   return (this->time_seconds - d.time_seconds);
  307. }
  308.  
  309.  
  310. // decr_sec -- Retreat Date/Time by "n" second(s)
  311. // Input:      Number of seconds to retreat (default 1)
  312. // Output:     None -- CoolDate_Time object updated 
  313.  
  314. inline void CoolDate_Time::decr_sec (int n) {
  315.   incr_sec (-n);
  316. }
  317.  
  318.  
  319. // decr_min -- Retreat Date/Time by "n" minute(s)
  320. // Input:      Number of minutes to retreat (default 1)
  321. // Output:     None -- CoolDate_Time object updated 
  322.  
  323. inline void CoolDate_Time::decr_min (int n) {
  324.   incr_min (-n);
  325. }
  326.  
  327.  
  328. // decr_hour -- Retreat Date/Time by "n" hour(s)
  329. // Input:       Number of hours to retreat (default 1)
  330. // Output:      None -- CoolDate_Time object updated 
  331.  
  332. inline void CoolDate_Time::decr_hour (int n) {
  333.   incr_hour (-n);
  334. }
  335.  
  336.  
  337. // decr_day -- Retreat Date/Time by "n" day(s)
  338. // Input:      Number of days to retreat (default 1)
  339. // Output:     None -- CoolDate_Time object updated 
  340.  
  341. inline void CoolDate_Time::decr_day (int n) {
  342.   incr_day (-n);
  343. }
  344.  
  345.  
  346. // decr_week -- Retreat Date/Time by "n" week(s)
  347. // Input:       Number of weeks to retreat (default 1)
  348. // Output:      None -- CoolDate_Time object updated 
  349.  
  350. inline void CoolDate_Time::decr_week (int n) {
  351.   incr_week (-n);
  352. }
  353.  
  354.  
  355. // operator== -- Determine if two CoolDate_Time objects represent the
  356. //               same point in time
  357. // Input:        this*, CoolDate_Time reference
  358. // Output:       TRUE/FALSE boolean value
  359.  
  360. inline Boolean CoolDate_Time::operator== (const CoolDate_Time& d) const {
  361.   return ((this->time_seconds == d.time_seconds) ? TRUE : FALSE);
  362. }
  363.  
  364.  
  365. // operator!= -- Determine if two CoolDate_Time objects represent 
  366. //               different points in time
  367. // Input:        this*, CoolDate_Time reference
  368. // Output:       TRUE/FALSE Boolean value
  369.  
  370. inline Boolean CoolDate_Time::operator!= (const CoolDate_Time& d) const {
  371.   return ((this->time_seconds != d.time_seconds) ? TRUE : FALSE);
  372. }
  373.  
  374.  
  375. // operator< -- Determine if one CoolDate_Time object comes before
  376. //              some other point in time
  377. // Input:       this*, CoolDate_Time reference
  378. // Output:      TRUE/FALSE Boolean value
  379.  
  380. inline Boolean CoolDate_Time::operator< (const CoolDate_Time& d) const {
  381.   return ((this->time_seconds < d.time_seconds) ? TRUE : FALSE);
  382. }
  383.  
  384.  
  385. // operator> -- Determine if one CoolDate_Time object comes aftern
  386. //              some other point in time
  387. // Input:       this*, CoolDate_Time reference
  388. // Output:      TRUE/FALSE Boolean value
  389.  
  390. inline Boolean CoolDate_Time::operator> (const CoolDate_Time& d) const {
  391.   return ((this->time_seconds > d.time_seconds) ? TRUE : FALSE);
  392. }
  393.  
  394.  
  395. // operator<= -- Compare one CoolDate_Time object to see if it lies before
  396. //               or is the same as another CoolDate_Time object
  397. // Input:        this*, CoolDate_Time reference
  398. // Output:       TRUE/FALSE Boolean value
  399.  
  400. inline Boolean CoolDate_Time::operator<= (const CoolDate_Time& d) const {
  401.   return ((this->time_seconds <= d.time_seconds) ? TRUE : FALSE);
  402. }
  403.  
  404.  
  405. // operator>= -- Compare one CoolDate_Time object to see if it lies after
  406. //               or is the same as another CoolDate_Time object
  407. // Input:        this*, CoolDate_Time reference
  408. // Output:       TRUE/FALSE boolean value
  409.  
  410. inline Boolean CoolDate_Time::operator>= (const CoolDate_Time& d) const {
  411.   return ((this->time_seconds >= d.time_seconds) ? TRUE : FALSE);
  412. }
  413.  
  414.  
  415. // get_sec -- Accessor to seconds slot value
  416. // Input:     this* 
  417. // Output:    Integer representing number of seconds
  418.  
  419. inline int CoolDate_Time::get_sec () const {
  420.   return (this->dt.tm_sec);
  421. }
  422.  
  423.  
  424. // get_min -- Accessor to minutes slot value
  425. // Input:     this* 
  426. // Output:    Integer representing number of minutes
  427.  
  428. inline int CoolDate_Time::get_min () const {
  429.   return (this->dt.tm_min);
  430. }
  431.  
  432.  
  433. // get_hour -- Accessor to hour slot value
  434. // Input:      this* 
  435. // Output:     Integer representing number of hour
  436.  
  437. inline int CoolDate_Time::get_hour () const {
  438.   return (this->dt.tm_hour);
  439. }
  440.  
  441.  
  442. // get_mday -- Accessor to day of month slot value
  443. // Input:      this* 
  444. // Output:     Integer representing day of month
  445.  
  446. inline int CoolDate_Time::get_mday () const {
  447.   return (this->dt.tm_mday);
  448. }
  449.  
  450.  
  451. // get_mon -- Accessor to month slot value
  452. // Input:     this* 
  453. // Output:    Integer representing month
  454.  
  455. inline int CoolDate_Time::get_mon () const {
  456.   return (this->dt.tm_mon);
  457. }
  458.  
  459.  
  460. #define YEAR_PERIOD 28
  461. #define NEW_YEAR(x) (((x / YEAR_PERIOD) * YEAR_PERIOD) + YEAR_PERIOD)
  462. #define OLD_YEAR(x,y) (x - NEW_YEAR (y))
  463.  
  464.  
  465. // get_year -- Accessor to year slot value
  466. // Input:      this* 
  467. // Output:     Integer representing year
  468.  
  469. inline int CoolDate_Time::get_year () const {
  470.   return ((this->year_adjust > 0) ? (this->century+OLD_YEAR (this->dt.tm_year,
  471.                            this->year_adjust)) :
  472.       this->century + this->dt.tm_year);
  473. }
  474.  
  475.  
  476. // get_yday -- Accessor to day of year slot value
  477. // Input:      this* 
  478. // Output:     Integer representing day of year
  479.  
  480. inline int CoolDate_Time::get_yday () const {
  481.   return (this->dt.tm_yday);
  482. }
  483.  
  484.  
  485. // get_wday -- Accessor to day of week slot value
  486. // Input:      this* 
  487. // Output:     Integer representing day of week
  488.  
  489. inline int CoolDate_Time::get_wday () const {
  490.   return (this->dt.tm_wday);
  491. }
  492.  
  493.  
  494. // is_day_light_savings -- Accessor to Day Light Savings time flag
  495. // Input:                  this* 
  496. // Output:                 TRUE/FALSE if in effect
  497.  
  498. inline Boolean CoolDate_Time::is_day_light_savings () const {
  499.   return ((this->dt.tm_isdst) ? TRUE : FALSE);
  500. }
  501.  
  502.  
  503. // get_time_zone -- Accessor to ASCII representation of time zone
  504. // Input:           this* 
  505. // Output:          character string representing time zone
  506.  
  507. inline const char* CoolDate_Time::get_time_zone () const {
  508.   return (tz_table[this->tz_code]);
  509. }
  510.  
  511.  
  512. // get_country -- Accessor to country code slot value
  513. // Input:         this* 
  514. // Output:        character string representing country
  515.  
  516. inline const char* CoolDate_Time::get_country () const {
  517.   return (country_names[this->c_code]);
  518. }
  519.  
  520.  
  521. // get_day_name -- Accessor to ASCII representation of week day
  522. // Input:         this* 
  523. // Output:        character string representing day of week
  524.  
  525. inline const char* CoolDate_Time::get_day_name () const {
  526.   return (day_names[this->dt.tm_wday]);
  527. }
  528.  
  529.  
  530. // get_month_name -- Accessor to ASCII representation of month
  531. // Input:         this* 
  532. // Output:        character string representing month
  533.  
  534. inline const char* CoolDate_Time::get_month_name () const {
  535.   return (month_names[this->dt.tm_mon]);
  536. }
  537.  
  538. // operator<< -- Output CoolDate_Time object to output stream
  539. // Input:        Output stream reference, CoolDate_Time pointer
  540. // Output:       Output stream reference
  541.  
  542. inline ostream& operator<< (ostream& os, const CoolDate_Time* d) {
  543.   return  os << *d;
  544. }
  545.  
  546.  
  547. #endif                                          // End of DATETIMEH
  548.